tg-me.com/java_codings/31
Last Update:
22. Binary Pattern
1
01
101
0101
10101
class BinaryPattern
{
public static void main(String s[])
{
int i, j;
int count = 1;
for (i = 1; i <= 5; i++)
{
for (j = 1; j <= i; j++)
{
System.out.format("%d", count++ % 2);
if (j == i && i != 5)
System.out.println("");
}
if (i % 2 == 0)
count = 1;
else
count = 0;
}
}
}
@java_Codings
BY Advance Java π¨βπ»
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/java_codings/31